//
//  CStateManager.m
//  ibasketball2D
//
//  Created by imac on 11-5-25.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "CStateManager.h"


@implementation CStateManager

//静态场景管理实例
static CStateManager* _sharedManager = nil;

//返回共享场景实例
+(id) SharedManager
{
	if (!_sharedManager) {
		_sharedManager = [[self alloc] init];
	}
	return _sharedManager;
}

//状态管理器初始化
-(id)init
{
	if( (self=[super init]) ) 
	{
		m_Gamestate = MainMenu_Run;
	}
	
	return self;
}

//内存释放
-(void)dealloc
{
	_sharedManager = nil;
	[super dealloc];
}

//设置当前游戏状态
//GameState: 当前游戏状态
-(void)SetGameState:(GameState)gamestate
{
	m_Gamestate = gamestate;
}

//获取当前游戏状态
-(GameState)getGameState
{
	return m_Gamestate;
}

@end
